package com.cheng.learn.designmode.prototype;

/**
 * @description: java原型设计模式，主要是实现cloneable接口
 * @author: ChengHaiZhu
 * @create: 2021-03-10 14:50
 **/
public class ProtoType implements Cloneable{

    /**
     * 利用克隆方法克隆对象
     * @return
     * @throws CloneNotSupportedException
     */
    public Object clone() throws CloneNotSupportedException {
        System.out.println("具体原型复制成功！");
        return (ProtoType) super.clone();
    }
}
